<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>

<?php
$form = $this->form;
$form->prepare();

$form->setAttributes(['class' => 'form-horizontal']);

$form->get('payPassword')->setAttributes(['class' => 'form-control', 'placeholder' => $this->translate('填写支付密码')]);
?>

<div class="container">
    <div class="xm-plain-box">
        <div class="box-hd">
            <h3 class="title"><?php echo $this->translate('余额支付'); ?></h3>
        </div>
    </div>
    <div class="box-hd">
        <p style="font-size:16px;margin-left: 450px;"><?php echo $this->translate('订单编号'); ?>：<?php echo $this->orderInfo->getOrderSn(); ?></p>
        <p style="font-size:16px;margin-left: 450px;"><?php echo $this->translate('订单金额'); ?>：<?php echo $this->shopHelper()->orderCurrency($this->orderInfo->getOrderAmount(), $this->orderInfo->getCurrencySymbol()); ?></p>
        <p style="font-size:16px;margin-left: 450px;"><?php echo $this->translate('我的余额'); ?>：<?php echo $this->shopCurrencyFormat($this->userInfo->getUserMoney()); if($this->currency['default']['code'] != $this->orderInfo->getCurrencyCode()) echo ' ('.$this->orderInfo->getCurrencySymbol().number_format($this->userInfo->getUserMoney() * $this->currency[$this->orderInfo->getCurrencyCode()]['rate'], 2, '.', '').')'; ?></p>
            <?php echo $this->partial('shop/message'); ?>
            <?php echo $this->form()->openTag($form); ?>
            <div style="font-size:16px;margin-left: 450px;">
            <?php echo $this->formElement($form->get('payPassword')); ?>
            <?php echo $this->formElementErrors($form->get('payPassword'), ['class'=>'error-message']); ?>
            <input type="submit" value="<?php echo $this->translate('点击完成支付'); ?>" class="btn btn-primary">
            </div>
            <?php echo $this->form()->closeTag(); ?>
    </div>
</div>
<script>
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                payPassword: {
                    required: true
                }
            },
            messages: {
                payPassword: {
                    required: "<?php echo $this->translate('支付密码不能为空!'); ?>"
                }
            }
        });
    });
</script>